/*
 * @(#)MaintFormSubmissionForm.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.form.web;

import java.util.HashMap;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;

import com.dcivision.form.bean.FormSubmission;
import com.dcivision.framework.ApplicationException;
import com.dcivision.framework.TextUtility;
import com.dcivision.framework.bean.AbstractBaseObject;
import com.dcivision.framework.web.AbstractActionForm;

/**
  MaintFormSubmissionForm.java

  This class is the for web form purpose.

  @author      Scott Tong
  @company     DCIVision Limited
  @creation date   07/01/2004
  @version     $Revision: 1.16 $
*/

public class MaintFormSubmissionForm extends AbstractActionForm implements com.dcivision.framework.web.WorkflowActionFormInterface {

  public static final String REVISION = "$Revision: 1.16 $";

  private String formRecordID = null;
  private String ip = null;
  private String guestName = null;
  private String email = null;
  private String contactInfo = null;
  private String status = null;
  private String submitFlag = null; //submit status is draft or submit.

  private String tempDate = null;

  /** Workflow Routine Fields */
  private String submitSystemWorkflow = null;
  private String sysWorkflowCategoryID = null;
  private String workflowRecordID = null;
  private String workflowComment = null;
  private String fileNames = null;
  private String displayFileNames = null;
  private String dmsFileNames = null;
  private String displayDmsFileNames = null;
  private String nextStepDueDates = null;
  private String nextStepAllowAssignDueDate = null;
  
  /** ListReportSummary for search */
  private String fromDate = null;
  private String toDate = null;
  protected String basicSearchField = null;
  protected String basicSearchKeyword = null;
  protected String basicSearchType = "LIKE";
  private String searchSubmitter = null;
  private String searchStatus = null;
  
  /** DMS Fields **/
  private String locationPath = null;
  private Integer dmsParentID = null;
  private Integer dmsRootID = null;
  
  /** Multi-Form **/
  private String trackID = null;  
  private String multiForm = null;
  private HashMap objParamMap = new HashMap();
  private String nextPDFUrl = null;
   
  public MaintFormSubmissionForm() {
    super();
  }

  public String getFormRecordID() {
    return(this.formRecordID);
  }

  public void setFormRecordID(String formRecordID) {
    this.formRecordID = formRecordID;
  }

  public String getIp() {
    return(this.ip);
  }

  public void setIp(String ip) {
    this.ip = ip;
  }

  public String getGuestName() {
    return(this.guestName);
  }

  public void setGuestName(String guestName) {
    this.guestName = guestName;
  }

  public String getEmail() {
    return(this.email);
  }

  public void setEmail(String email) {
    this.email = email;
  }

  public String getContactInfo() {
    return(this.contactInfo);
  }

  public void setContactInfo(String contactInfo) {
    this.contactInfo = contactInfo;
  }

  public Integer getDmsParentID() {
    return dmsParentID;
  }

  public void setDmsParentID(Integer dmsParentID) {
    this.dmsParentID = dmsParentID;
  }

  public Integer getDmsRootID() {
    return dmsRootID;
  }
    
  public void setDmsRootID(Integer dmsRootID) {
    this.dmsRootID = dmsRootID;
  }
    
  public String getStatus() {
    return(this.status);
  }

  public void setStatus(String status) {
    this.status = status;
  }

  public String getSubmitFlag() {
    return submitFlag;
  }
  
  public void setSubmitFlag(String submitFlag) {
    this.submitFlag = submitFlag;
  }
  
  public String getTempDate() {
    return(this.tempDate);
  }

  public void setTempDate(String tempDate) {
    this.tempDate = tempDate;
  }


  public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    return super.validate(mapping, request);
  }

  public void reset(ActionMapping mapping, HttpServletRequest request) {
    super.reset(mapping, request);
    this.setID(null);
    this.setTrackID(null);
    this.setFormRecordID(null);
    this.setWorkflowRecordID(null);
    this.setIp(null);
    this.setGuestName(null);
    this.setEmail(null);
    this.setContactInfo(null);
    this.setStatus(null);
    this.setRecordStatus(null);
    this.setUpdateCount(null);
    this.setCreatorID(null);
    this.setCreateDate(null);
    this.setUpdaterID(null);
    this.setUpdateDate(null);
  }

  public AbstractBaseObject getFormData() throws ApplicationException {
    FormSubmission tmpFormSubmission = new FormSubmission();
    tmpFormSubmission.setID(TextUtility.parseIntegerObj(this.getID()));
    tmpFormSubmission.setTrackID(TextUtility.parseIntegerObj(this.getTrackID()));
    tmpFormSubmission.setFormRecordID(TextUtility.parseIntegerObj(this.getFormRecordID()));
    tmpFormSubmission.setWorkflowRecordID(TextUtility.parseIntegerObj(this.getWorkflowRecordID()));
    tmpFormSubmission.setIp(this.getIp());
    tmpFormSubmission.setGuestName(this.getGuestName());
    tmpFormSubmission.setEmail(this.getEmail());
    tmpFormSubmission.setContactInfo(this.getContactInfo());
    tmpFormSubmission.setDmsParentID(this.getDmsParentID());
    tmpFormSubmission.setStatus(this.getStatus());
    tmpFormSubmission.setRecordStatus(this.getRecordStatus());
    tmpFormSubmission.setUpdateCount(TextUtility.parseIntegerObj(this.getUpdateCount()));
    tmpFormSubmission.setCreatorID(TextUtility.parseIntegerObj(this.getCreatorID()));
    tmpFormSubmission.setCreateDate(parseTimestamp(this.getCreateDate()));
    tmpFormSubmission.setUpdaterID(TextUtility.parseIntegerObj(this.getUpdaterID()));
    tmpFormSubmission.setUpdateDate(parseTimestamp(this.getUpdateDate()));
    return tmpFormSubmission;
  }

  public void setFormData(AbstractBaseObject baseObj) throws ApplicationException {
    FormSubmission tmpFormSubmission = (FormSubmission)baseObj;
    this.setID(TextUtility.formatIntegerObj(tmpFormSubmission.getID()));
    this.setTrackID(TextUtility.formatIntegerObj(tmpFormSubmission.getTrackID()));
    this.setFormRecordID(TextUtility.formatIntegerObj(tmpFormSubmission.getFormRecordID()));
    this.setWorkflowRecordID(TextUtility.formatIntegerObj(tmpFormSubmission.getWorkflowRecordID()));
    this.setIp(tmpFormSubmission.getIp());
    this.setGuestName(tmpFormSubmission.getGuestName());
    this.setEmail(tmpFormSubmission.getEmail());
    this.setContactInfo(tmpFormSubmission.getContactInfo());
    this.setDmsParentID(tmpFormSubmission.getDmsParentID());
    this.setStatus(tmpFormSubmission.getStatus());
    this.setRecordStatus(tmpFormSubmission.getRecordStatus());
    this.setUpdateCount(TextUtility.formatIntegerObj(tmpFormSubmission.getUpdateCount()));
    this.setCreatorID(TextUtility.formatIntegerObj(tmpFormSubmission.getCreatorID()));
    this.setCreateDate(formatTimestamp(tmpFormSubmission.getCreateDate()));
    this.setUpdaterID(TextUtility.formatIntegerObj(tmpFormSubmission.getUpdaterID()));
    this.setUpdateDate(formatTimestamp(tmpFormSubmission.getUpdateDate()));
  }

  public String getSubmitSystemWorkflow() {
    return(this.submitSystemWorkflow);
  }

  public void setSubmitSystemWorkflow(String submitSystemWorkflow) {
    this.submitSystemWorkflow = submitSystemWorkflow;
  }

  public String getSysWorkflowCategoryID() {
    return(this.sysWorkflowCategoryID);
  }

  public void setSysWorkflowCategoryID(String sysWorkflowCategoryID) {
    this.sysWorkflowCategoryID = sysWorkflowCategoryID;
  }

  public String getWorkflowRecordID() {
    return(this.workflowRecordID);
  }

  public void setWorkflowRecordID(String workflowRecordID) {
    this.workflowRecordID = workflowRecordID;
  }

  public String getWorkflowComment() {
    return(this.workflowComment);
  }

  public void setWorkflowComment(String workflowComment) {
    this.workflowComment = workflowComment;
  }

  public String getFromDate() {
    return this.fromDate;
  }

  public void setFromDate (String fromDate){
    this.fromDate = fromDate;
  }

  public String getToDate(){
    return this.toDate;
  }

  public void setToDate (String toDate) {
    this.toDate = toDate;
  }

  public String getBasicSearchField() {
    return(this.basicSearchField);
  }

  public void setBasicSearchField(String basicSearchField) {
    this.basicSearchField = basicSearchField;
  }

  public String getBasicSearchKeyword() {
    return(this.basicSearchKeyword);
  }

  public void setBasicSearchKeyword(String basicSearchKeyword) {
    this.basicSearchKeyword = basicSearchKeyword;
  }

  public String getBasicSearchType() {
    return(this.basicSearchType);
  }

  public void setBasicSearchType(String basicSearchType) {
    this.basicSearchType = basicSearchType;
  }
  
  public String getSearchSubmitter() {
    return(this.searchSubmitter);
  }

  public void setSearchSubmitter(String searchSubmitter) {
    this.searchSubmitter = searchSubmitter;
  }
  
  public String getSearchStatus() {
    return(this.searchStatus);
  }

  public void setSearchStatus(String searchStatus) {
    this.searchStatus = searchStatus;
  }
  
  public String getFileNames(){
    return this.fileNames;
  }

  public void setFileNames(String fileNames){
    this.fileNames = fileNames;
  }
  
  public String getDisplayFileNames() {
  	return this.displayFileNames;
  }
  
  public void setDisplayFileNames(String displayFileNames){
  	this.displayFileNames = displayFileNames;
  }
  
  public String getDmsFileNames(){
    return this.dmsFileNames;
  }

  public void setDmsFileNames(String dmsFileNames){
    this.dmsFileNames = dmsFileNames;
  }
  
  public String getDisplayDmsFileNames() {
  	return this.displayDmsFileNames;
  }
  
  public void setDisplayDmsFileNames(String displayDmsFileNames){
  	this.displayDmsFileNames = displayDmsFileNames;
  }
  
  public String getNextStepDueDates(){
    return this.nextStepDueDates;  
  }
  
  public void setNextStepDueDates(String nextStepDueDates) {
    this.nextStepDueDates = nextStepDueDates; 
  }
  
  public String getNextStepAllowAssignDueDate(){
    return this.nextStepAllowAssignDueDate;  
  }
  
  public void setNextStepAllowAssignDueDate(String nextStepAllowAssignDueDate){
    this.nextStepAllowAssignDueDate = nextStepAllowAssignDueDate;  
  }
  
  public String getLocationPath(){
    return this.locationPath;  
  }
  
  public void setLocationPath(String locationPath){
    this.locationPath = locationPath;  
  }
  
  public String getTrackID() {
  	return trackID;
  }
  
  public void setTrackID(String trackID) {
  	this.trackID = trackID;
  }
    
  public String getMultiForm() {
  	return multiForm;
  }
  
  public void setMultiForm(String multiForm) {
  	this.multiForm = multiForm;
  }
    
  public HashMap getObjParamMap() {
  	return objParamMap;
  }
  
  public void setObjParamMap(HashMap objParamMap) {
  	this.objParamMap = objParamMap;
  }
  
  public String getNextPDFUrl() {
  	return nextPDFUrl;
  }
  
  public void setNextPDFUrl(String nextPDFUrl) {
  	this.nextPDFUrl = nextPDFUrl;
  }
  
}
